<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script type='text/javascript' src='http://localhost/HDPHP/hdphp/hdphp/Extend/Org/Jquery/jquery-1.8.2.min.js'></script>
<link href='http://localhost/HDPHP/hdphp/hdphp/Extend/Org/hdjs/hdui/css/hdui.css' rel='stylesheet' media='screen'>
<script src='http://localhost/HDPHP/hdphp/hdphp/Extend/Org/hdjs/hdui/js/hdui.js'></script>
<link href='http://localhost/HDPHP/hdphp/hdphp/Extend/Org/hdjs/hdvalidate/css/hdvalidate.css' rel='stylesheet' media='screen'>
<script src='http://localhost/HDPHP/hdphp/hdphp/Extend/Org/hdjs/hdvalidate/js/hdvalidate.js'></script>
<script src='http://localhost/HDPHP/hdphp/hdphp/Extend/Org/cal/lhgcalendar.min.js'></script>
<script src='http://localhost/HDPHP/hdphp/hdphp/Extend/Org/hdjs/hdslide/js/hdslide.js'></script>
<script type='text/javascript'>
HOST = 'http://localhost';
ROOT = 'http://localhost/me/12.6/second_shop/Eshop';
WEB = 'http://localhost/me/12.6/second_shop/Eshop/index.php';
URL = 'http://localhost/me/12.6/second_shop/Eshop/index.php/Admin/Attribute/index/cat_id/1';
APP = 'http://localhost/me/12.6/second_shop/Eshop/Eshop';
COMMON = 'http://localhost/me/12.6/second_shop/Eshop/Eshop/Common';
HDPHP = 'http://localhost/HDPHP/hdphp/hdphp';
HDPHPDATA = 'http://localhost/HDPHP/hdphp/hdphp/Data';
HDPHPEXTEND = 'http://localhost/HDPHP/hdphp/hdphp/Extend';
MODULE = 'http://localhost/me/12.6/second_shop/Eshop/index.php/Admin';
CONTROLLER = 'http://localhost/me/12.6/second_shop/Eshop/index.php/Admin/Attribute';
ACTION = 'http://localhost/me/12.6/second_shop/Eshop/index.php/Admin/Attribute/index';
STATIC = 'http://localhost/me/12.6/second_shop/Eshop/Static';
HDPHPTPL = 'http://localhost/HDPHP/hdphp/hdphp/Lib/Tpl';
VIEW = 'http://localhost/me/12.6/second_shop/Eshop/Eshop/Admin/View';
PUBLIC = 'http://localhost/me/12.6/second_shop/Eshop/Eshop/Admin/View/Public';
CONTROLLERVIEW = 'http://localhost/me/12.6/second_shop/Eshop/Eshop/Admin/View/Attribute';
HISTORY = 'http://localhost/me/12.6/second_shop/Eshop/index.php/Admin/GoodsType/index';
</script>
</head>
<body>
	<div class="wrap">
		<div class="menu_list">
			<ul>
				<li><a href="<?php echo U('index');?>" class="action">属性列表</a></li>
				<li><a href="<?php echo U('add',array('cat_id'=>Q('cat_id')));?>">属性添加</a></li>
				<li>
					<select onchange="changeGoodsType(this)">
						<option value="0">==商品类型</option>
						<?php $hd["list"]["gt"]["total"]=0;if(isset($goods_type) && !empty($goods_type)):$_id_gt=0;$_index_gt=0;$lastgt=min(1000,count($goods_type));
$hd["list"]["gt"]["first"]=true;
$hd["list"]["gt"]["last"]=false;
$_total_gt=ceil($lastgt/1);$hd["list"]["gt"]["total"]=$_total_gt;
$_data_gt = array_slice($goods_type,0,$lastgt);
if(count($_data_gt)==0):echo "";
else:
foreach($_data_gt as $key=>$gt):
if(($_id_gt)%1==0):$_id_gt++;else:$_id_gt++;continue;endif;
$hd["list"]["gt"]["index"]=++$_index_gt;
if($_index_gt>=$_total_gt):$hd["list"]["gt"]["last"]=true;endif;?>

							<option value="<?php echo $gt['cat_id'];?>"><?php echo $gt['cat_name'];?></option>
						<?php $hd["list"]["gt"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
					</select>
				</li>
			</ul>
		</div>
		<form action="" method="post">
			<table class="table2">
				<thead>
					<tr>
						<td class="w50">ID</td>
						<td>属性列表</td>
						<td>类型</td>
						<td>录入方式</td>
						<td>可选值列表</td>
						<td>CAT_ID</td>
						<td class="w200">操作</td>
					</tr>
				</thead>
				<tbody>
					<?php $hd["list"]["a"]["total"]=0;if(isset($attribute) && !empty($attribute)):$_id_a=0;$_index_a=0;$lasta=min(1000,count($attribute));
$hd["list"]["a"]["first"]=true;
$hd["list"]["a"]["last"]=false;
$_total_a=ceil($lasta/1);$hd["list"]["a"]["total"]=$_total_a;
$_data_a = array_slice($attribute,0,$lasta);
if(count($_data_a)==0):echo "";
else:
foreach($_data_a as $key=>$a):
if(($_id_a)%1==0):$_id_a++;else:$_id_a++;continue;endif;
$hd["list"]["a"]["index"]=++$_index_a;
if($_index_a>=$_total_a):$hd["list"]["a"]["last"]=true;endif;?>

						<tr>
							<td><?php echo $a['attr_id'];?></td>
							<td><?php echo $a['attr_name'];?></td>
							<td><?php echo $a['attr_type_text'];?></td>
							<td><?php echo $a['attr_input_type_text'];?></td>
							<td>
								<?php echo implode(',', explode("\n",$d['attr_value']));?>
							</td>
							<td><?php echo $a['cat_id'];?></td>
							<td>
								<a href="<?php echo U('edit',array('attr_id'=>$a['attr_id']));?>">编辑</a>|
								<a href="<?php echo U('del',array('attr_id'=>$a['attr_id']));?>">删除</a>
							</td>
						</tr>
					<?php $hd["list"]["a"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
				</tbody>
			</table>		
		</form>
	<script type="text/javascript" src="http://localhost/me/12.6/second_shop/Eshop/Eshop/Admin/View/Attribute/Js/index.js"></script>	
	</div>
</body>
</html>